<template>
<uni-shadow-root class="partials-task_list-type_one-index"><template name="typeOne">
    <view class="container">
        <view class="task_list" v-if="taskList&&taskList.length!=0" style="height: receiveData.androidTemplate=='typeOne'?'0':'80rpx'">
            <view v-for="(item,index) in (taskList)" class="task_item" :data-link="'task_detail.html?taskId='+(item.id)" @click="tolinkUrl" v-if="limitState!=0?index<receiveData.jsonData.count:'ture'">
                <view class="task_item_top">
                    <text class="task_type_tag" :style="'background:'+(defaultColor)" v-if="item.topOrder>0">顶</text>
                    <text class="task_type_tag" :style="'background:'+(defaultColor)" v-if="item.taskMode==1">抢单</text>
                    <text class="task_type_tag" :style="'background:'+(defaultColor)" v-if="item.taskMode==2">预选</text>
                    <text class="task_item_price" :style="'color:'+(defaultColor)" v-if="item.priceMode==0">免费</text>
                    <text class="task_item_price" :style="'color:'+(defaultColor)" v-if="item.priceMode==1">可议价</text>
                    <text class="task_item_price" :style="'color:'+(defaultColor)" v-if="item.priceMode==2">￥{{item.taskPrice}}</text>
                    <text class="task_item_name">{{item.name}}</text>
                    <image class="hb_block" v-if="item.tipPrice" src="https://image1.sansancloud.com/xianhua/2020_5/8/10/20/37_663.jpg?x-oss-process=style/preview_120"></image>
                </view>
                <view class="task_item_content">
                    {{item.content}}
                </view>
                <scroll-view class="tags_content" scroll-x v-if="item.tags">
                  <text v-for="(item,index) in (item.managerTagArray)" class="tags_item" :style="'background:'+(defaultColor)+'22;color:'+(defaultColor)">{{item}}</text>
                  <text v-for="(item,index) in (item.tagArray)" class="tags_item" style="border: 1rpx solid #eee;">{{item}}</text>
                </scroll-view>
                <view class="task_item_bottom">
                    <view class="task_item_attend_count">终选<text :style="'color:'+(defaultColor)+';margin:0 4rpx'">{{item.taskServantCount||0}}</text>人</view>
                    <view class="task_item_state">
                        <text class="task_item_state_text" v-if="item.taskStatus==0">未发布</text>
                        <text class="task_item_state_text" v-if="item.taskStatus==1">待审核</text>
                        <text class="task_item_state_text" v-if="item.taskStatus==2">审核拒绝</text>
                        <text class="task_item_state_text" v-if="item.taskStatus==3">{{item.taskEndTime||'不限期'}}截止</text>
                        <text class="task_item_state_text" v-if="item.taskStatus==4">任务进行中</text>
                        <text class="task_item_state_text" v-if="item.taskStatus==5">待验收</text>
                        <text class="task_item_state_text" v-if="item.taskStatus==6">已完成</text>
                    </view>
                </view>
            </view>
        </view>
        <view class="noproduct" v-else style="margin-top: receiveData.androidTemplate=='typeOne'?'100rpx':'200rpx'">
          <image mode="widthFix" src="https://image1.sansancloud.com/xianhua/2019_12/16/15/54/55_950.jpg?x-oss-process=style/preview_120"></image>
          <text>没有相关任务</text>
        </view>
    </view>
</template></uni-shadow-root>
</template>

<script>

global['__wxRoute'] = 'partials/task_list/type_one/index'

Component({})

export default global['__wxComponents']['partials/task_list/type_one/index']
</script>
<style platform="mp-weixin">
.task_list{
    /* margin-top: 80rpx; */
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20rpx 15rpx;
    box-sizing: border-box;
}
.task_item{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1rpx solid #eee;
    padding: 20rpx;
    box-sizing: border-box;
    background: #f9f9f9;
    margin-bottom: 20rpx;
}
.task_item_top{
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    margin-bottom: 10rpx;
    position: relative;
}
.task_item_price{
    margin-right: 20rpx;
}
.task_item_name{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 65%;
}
.task_type_tag{
    color: #fff;
    padding: 4rpx 10rpx;
    font-size: 22rpx;
    margin-right: 10rpx;
    border-radius: 6rpx;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}
.task_item_content{
    width: 100%;
    margin: 20rpx 0;
    color: #666;
    font-size: 26rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;

}
.task_item_bottom{
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    color: #666;
    font-size: 24rpx;
}
/*没有相关商品  */
.noproduct{
  width: 100%;
  height: 200rpx;
  text-align: center;
  display: flex;
  flex-direction: column;
  margin-top: 200rpx;
}
.noproduct image{
  width: 150rpx;
  height: 150rpx;
  margin: 0 auto;
}
.noproduct text{
  font-size: 30rpx;
}
.tags_content{
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow-x:hidden;
  width:100%;
  height:50rpx;
  white-space: nowrap;
  margin-bottom: 20rpx;
}
.tags_item{
  padding: 4rpx 14rpx;
  font-size: 24rpx;
  color: #888;
  margin-right: 10rpx;
  border-radius: 4rpx;
  white-space: nowrap;
  box-sizing: content-box;
  display: inline-block;
  background: #fff;
}
.hb_block{
    width: 30rpx;
    height: 35rpx;
    position: absolute;
    right: 0;
    top: 0;
}
</style>